(function() {
    var myApp = angular.module('myApp');


    //设置角色用户
    myApp.constant("myGroupUserTableOption",  {
        dom        : 'trip',
        ordering : false,
        processing : true,
        serverSide : true,
        deferRender: true,
        scrollY    : '100%',
        paging     : true,
        scroller   : true,
        order      : [[0, 'desc']],
        searchDelay: 1000,
        pageLength : 1000,
        language   : { url: '../../pub/datatables/zh_cn.json' },
        columns    : [
            {
                searchable: false,
                render : function ( data, type, row, meta ) {
                    if(row.selected==1){
                        return '<input type="checkbox" checked="checked" style="height: 15px;width: 15px;" ng-click="changeUsers('+meta.row+')" >'
                    }else{
                        return '<input type="checkbox"  style="height: 15px;width: 15px;" ng-click="changeUsers('+meta.row+')" >'
                    }
                }
            },
            { data: 'cellphone_mail' 	},
            { data: 'user_name' },
            { data: 'email' },
            { data: 'cellphone' },
            {
                data: 'active_status',
                render : function ( data, type, row, meta ) {
                    return data == 'Y' ? '启用' : '禁用';
                }
            }
        ]
    });
    myApp.constant("candidateUsersTableOption", {
        dom        : 'ftir',
        processing : true,
        serverSide : true,
        deferRender: true,
        scrollY    : '100%',
        paging     : false,
        scroller   : false,
        select     : true,
        searchDelay: 1000,
        language   : { url: '../../pub/datatables/zh_cn.json' },
        order      : [[ 1, 'asc' ]],
        columns    : [
            {
                orderable: false,
                className: 'select-checkbox',
                render : function ( data, type, row, meta ) {
                    return '';
                }
            },
            { data: 'role_id' 	},
            { data: 'name' },
            { data: 'descr' },
            {
                data: 'status',
                render : function ( data, type, row, meta ) {
                    return data == 1 ? '启用' : '禁用';
                }
            }
        ]
    });

})();



